<?php

class McCube_Html_Form_Element_Input extends McCube_Html_Form_Element{

    public $type = '';

    /** */
    public function __construct($type, $name, $attrs=array()){
        parent::__construct($name, $attrs);
        $this->type = $type;
        if($this->type == 'button' || $this->type == 'submit'){
            $this->_config['decorator'] = 'void';
        }
    }

    /** */
    protected function _build(){
        return '<input type="'.$this->type.'" value="'.addslashes($this->_value).'"'
            .parent::buildAttrs()
        .' />';
    }
}